package com.ittony.mapper;

import com.github.pagehelper.Page;
import com.ittony.annotation.AutoFill;
import com.ittony.dto.EmployeePageQueryDTO;
import com.ittony.entity.Employee;
import com.ittony.enumeration.OperationType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface EmployeeMapper {

    Employee getByUsername(@Param("username") String username);

    @AutoFill(OperationType.INSERT)
    void insert(Employee employee);

    Page<Employee> pageQuery(EmployeePageQueryDTO employeePageQueryDTO);

    @AutoFill(OperationType.UPDATE)
    void update(Employee employee);

    Employee findEmployeeById(Long id);
}
